/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2012
 */

package com.asiainfo_linkage.model;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Id;
import org.nutz.dao.entity.annotation.Name;
import org.nutz.dao.entity.annotation.Table;

import com.asiainfo_linkage.utils.DateUtils;


/**
 * @author badqiu email:badqiu(a)gmail.com
 * @version 1.0
 * @since 1.0
 */

@Table(value = "sample")
public class Sample implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	
	//date formats
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大�?0")显示错误消息
	//columns START
	
	@Column	  // 表示该对象属性可以映射到数据库里作为一个字段
	@Id       // 表示该字段为一个自增长的Id
	private java.lang.Long id;
	
	@Column
	@Name    // 表示该字段可以用来标识此对象，或者是字符型主键，或者是唯一性约束
	private java.lang.String name;
	
	@Column
	private java.lang.String remark;
	
	@Column
	private java.lang.Boolean sex;
	
	@Column
	private java.lang.Double weight;
	
	@Column("create_time")
	private java.util.Date createTime;
	//columns END

	public Sample(){
	}

	public Sample(
		java.lang.Long id
	){
		this.id = id;
	}

	public void setId(java.lang.Long value) {
		this.id = value;
	}
	
	public java.lang.Long getId() {
		return this.id;
	}
	public void setName(java.lang.String value) {
		this.name = value;
	}
	
	public java.lang.String getName() {
		return this.name;
	}
	public void setRemark(java.lang.String value) {
		this.remark = value;
	}
	
	public java.lang.String getRemark() {
		return this.remark;
	}
	public void setSex(java.lang.Boolean value) {
		this.sex = value;
	}
	
	public java.lang.Boolean getSex() {
		return this.sex;
	}
	public void setWeight(java.lang.Double value) {
		this.weight = value;
	}
	
	public java.lang.Double getWeight() {
		return this.weight;
	}
	
	public java.util.Date getCreateTime() {
		return createTime;
	}

	public String getCreateTimeString() {
		return DateUtils.dateToShortStr(getCreateTime());
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("Name",getName())
			.append("Remark",getRemark())
			.append("Sex",getSex())
			.append("Weight",getWeight())
			.append("createTime",getCreateTime())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof Sample == false) return false;
		if(this == obj) return true;
		Sample other = (Sample)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

